import {Component, OnInit} from '@angular/core';
// import {trigger, state, style, animate, transition} from '@angular/animations';
import { heroState } from '../animations/switch';
import { flyInOut } from '../animations/flyInOut';
@Component({
  selector: 'app-animation',
  templateUrl: './animation.component.html',
  styleUrls: ['./animation.component.css'],
  animations: [heroState,flyInOut]
})
export class AnimationComponent implements OnInit {
  constructor() {
  }

  heroes = [
    {name: '张三'},
    {name: '李四'},
    {name: '王五'}
  ];
  state = 'inactive';

  toggleState() {
    if(this.state=='inactive'){
      this.state = 'active';
    }else{
      this.state = 'inactive';
    }
  }

  ngOnInit() {
  }

}
